/* eslint-disable */
<template>
  <div class="list-model">
    <div class="table-box">
      <el-table
        :data="list"
        size="mini"
        style="width: 100%"
      >
        <el-table-column
          prop="productNo"
          label="编号"
          type="index"
          min-width="80"
        >
        </el-table-column>
        <el-table-column
          prop="productName"
          label="任务名称"
          min-width="100"
        >
        </el-table-column>
        <el-table-column
          prop="productName"
          label="工作流名称"
          min-width="140"
        >
        </el-table-column>
        <el-table-column
          prop="productType"
          label="工作流状态"
          min-width="100"
        >
          <template slot-scope="scope">
            <div>{{scope.row.productType===1?'已上线':'已下线'}}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="productSource"
          label="任务类型"
          min-width="100"
        >
          <template slot-scope="scope">
            <div>{{scope.row.productSource===1?'SPARK':'MR'}}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="price"
          label="版本"
          min-width="100"
        >
          <template slot-scope="scope">

            <div>{{'V'+scope.row.price}}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="deployTime"
          label="创建时间"
          min-width="120"
        >
        </el-table-column>
        <el-table-column
          label="更新时间"
          min-width="120"
          prop="updateTime"
        >
        </el-table-column>
        <el-table-column
          label="操作"
          width="120"
        >
          <template slot-scope="scope">
            <el-tooltip
              v-auth="['projects:definition:edit']"
              :content="$t('Edit')"
              placement="top"
              :enterable="false"
            >
              <span><el-button
                  type="primary"
                  size="mini"
                  icon="el-icon-edit-outline"
                  @click="_edit(scope.row)"
                  circle
                ></el-button></span>
            </el-tooltip>
            <el-tooltip
              :content="$t('Version Info')"
              placement="top"
              :enterable="false"
            >
              <span><el-button
                  type="primary"
                  size="mini"
                  icon="el-icon-info"
                  @click="_version(scope.row)"
                  circle
                ></el-button></span>
            </el-tooltip>
            <el-tooltip
              :content="$t('Delete')"
              placement="top"
              :enterable="false"
            >
              <el-popconfirm
                :confirmButtonText="$t('Confirm')"
                :cancelButtonText="$t('Cancel')"
                icon="el-icon-info"
                iconColor="red"
                :title="$t('Delete?')"
                @onConfirm="_delete(scope.row,scope.row.id)"
              >
                <el-button
                  type="danger"
                  size="mini"
                  icon="el-icon-delete"
                  circle
                  slot="reference"
                ></el-button>
              </el-popconfirm>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <nodeTask
      v-if="editShow"
      ref="nodeTask"
    />
  </div>
</template>
<script>
  import nodeTask from './nodeTask.vue'
  export default {
    name: 'tenement-list',
    data () {
      return {
        editShow: false,
        list: [],
      }
    },
    props: {
      searchVal: String,
      tenementList: Array,
      pageNo: Number,
      pageSize: Number
    },
    methods: {
      _edit (row) {
        this.editShow = true
        this.$nextTick(() => {
          this.$refs.nodeTask.show(row)
        })
      },
      update () {
        this.$emit('on-update')
      },
    },
    watch: {
      tenementList (a) {
        this.list = []
        setTimeout(() => {
          this.list = a
        })
      }
    },
    created () {
      this.list = this.tenementList
    },
    mounted () { },
    components: { nodeTask }
  }
</script>

<style lang="scss" rel="stylesheet/scss" scoped>
</style>
